package com.zcoj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zcoj.mapper.SourceMapper;
import com.zcoj.pojo.Dto.Source;
import com.zcoj.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chenbin
 * @version 1.0
 * @description: TODO
 * @date 2023/3/30 16:00
 */
@Service
public class SourceServiceImpl implements SourceService {

    @Autowired
    private SourceMapper sourceMapper;

    @Override
    public Integer create(Source source) {
        return sourceMapper.insert(source);
    }

    @Override
    public List<Source> findAll() {
        return sourceMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Source findById(Integer id) {
        return sourceMapper.selectById(id);
    }

    @Override
    public Integer deleteById(Integer id) {
        return sourceMapper.deleteById(id);
    }

    @Override
    public Integer updateById(Source source) {
        return sourceMapper.updateById(source);
    }
}
